package com.ruoyi.web.controller.socket;

import cn.hutool.json.JSONObject;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@RestController
@RequestMapping("dzwl")
public class Dzwl {

    @GetMapping("/message")
    public void e(HttpServletResponse response) throws IOException {
        response.setHeader("Access-Control-Allow-Origin", "*");
        JSONObject jsonObject_one = new JSONObject();
        jsonObject_one.put("instruction","resetpoi");
        WebSocketController.sendInfo(jsonObject_one.toString(), "connect");

        JSONObject jsonObject2 = new JSONObject();
        JSONObject json2 = new JSONObject();
        jsonObject2.put("instruction","showpoi");
        json2.put("showtype","group");
        json2.put("poigroup","dianziweilan");
        json2.put("poitype","dianziweilan");
        jsonObject2.put("param",json2);
        WebSocketController.sendInfo(jsonObject2.toString(), "connect");
    }
}
